package top.wshape1.shiziapi.project.feign;

import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestHeader;
import org.springframework.web.bind.annotation.RequestParam;
import top.wshape1.shiziapi.common.constant.AuthConstant;
import top.wshape1.shiziapi.common.domain.to.ProjectUserIdTo;
import top.wshape1.shiziapi.common.utils.R;

/**
 * @author Wshape1
 * @version 1.0
 * @description
 * @since 2023-10-05
 */

@FeignClient("shiziapi-message")
public interface MessageFeignService {
    @GetMapping("/message/send/invite")
    R<Void> sendInviteMsg(@RequestParam("projectId") Long projectId,
                          @RequestParam("projectName") String projectName,
                          @RequestParam("userId") Long userId,
                          @RequestParam("userName") String userName,
                          @RequestParam("memberId") Long memberId
    );

    @GetMapping("/message/send/reject")
    R<Void> sendRejectMsg(@RequestParam("projectId") Long projectId,
                          @RequestParam("projectName") String projectName,
                          @RequestParam("memberId") Long memberId,
                          @RequestParam("memberName") String memberName,
                          @RequestParam("userId") Long userId
    );

    @GetMapping("/message/getProjectUserId")
    R<ProjectUserIdTo> getProjectUserId(@RequestParam("msgId") Long msgId);


    @GetMapping("/message/read/invite")
    R<Void> readInviteMsg(@RequestParam("msgId") Long msgId,
                          @RequestHeader(AuthConstant.HEADER_PAYLOAD_NAME) String userBase64);
}
